package com.hds.modules.app.enums;

/**
 * @Author guonan
 * @Email guonan@yewcn.com
 * @Description
 * @Date 2018/6/14 13:58
 */
public interface UserEnum {

    enum VipLevel{
        TOURIST(1,"注册会员"),
        VIP(2,"VIP会员"),
        GOLD(3,"金卡会员");

        VipLevel(Integer level, String desc) {
            this.level = level;
            this.desc = desc;
        }

        private Integer level;

        private String desc;

        public Integer getLevel() {
            return level;
        }

        public String getDesc() {
            return desc;
        }


        // 根据value返回枚举类型,主要在switch中使用
        public static VipLevel getByValue(int value) {
            for (VipLevel state : values()) {
                if (state.getLevel() == value) {
                    return state;
                }
            }
            return null;
        }
    }


}
